﻿using System;
using System.Diagnostics;
using Mapster;

namespace DiagnosticSourceDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            DiagnosticListener dl = new DiagnosticListener("DiagnosticTest");
            MessageData data = new MessageData { MsgType = 1, Msg = "2211" };
            dl.SubscribeWithAdapter(new MyDataSource());
            dl.Write("test", new SendData<MessageData> { Data = data });
            TypeAdapterConfig.GlobalSettings.Default.AddDestinationTransform<TypeAdapterSetter,string>( (value) => value ?? string.Empty);
            TypeAdapterConfig.GlobalSettings.Default.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase);
            var destination = data.Adapt<MessageData, MessageDes>();

            Console.ReadKey();
        }
    }
}
